package wowraidmanager.shared.model.wishlist;

import java.io.Serializable;
import java.util.ArrayList;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;

@Model(schemaVersion = 1)
public class RaidbossDroplist implements Serializable{

    private static final long serialVersionUID = 1L;

    @Attribute(primaryKey = true)
    private Key key;

    @Attribute(version = true)
    private Long version;

    private String bossName;

    private String bossId;

    private String raidzone;

    private String gameVersion;

    private long order;

    @Attribute(lob = true)
    private ArrayList<Droplist> droplist;

    /**
     * Returns the key.
     *
     * @return the key
     */
    public Key getKey(){
        return key;
    }

    /**
     * Sets the key.
     *
     * @param key
     *            the key
     */
    public void setKey(Key key){
        this.key = key;
    }

    /**
     * Returns the version.
     *
     * @return the version
     */
    public Long getVersion(){
        return version;
    }

    /**
     * Sets the version.
     *
     * @param version
     *            the version
     */
    public void setVersion(Long version){
        this.version = version;
    }

    public String getBossName(){
        return bossName;
    }

    public void setBossName(String bossName){
        this.bossName = bossName;
    }

    public void setBossId(String bossId){
        this.bossId = bossId;
    }

    public String getBossId(){
        return bossId;
    }

    public void setRaidzone(String raidzone){
        this.raidzone = raidzone;
    }

    public String getRaidzone(){
        return raidzone;
    }

    public void setGameVersion(String gameVersion){
        this.gameVersion = gameVersion;
    }

    public String getGameVersion(){
        return gameVersion;
    }

    public void setOrder(long order){
        this.order = order;
    }

    public long getOrder(){
        return order;
    }

    public ArrayList<Droplist> getDroplist(){
        return droplist;
    }

    public void setDroplist(ArrayList<Droplist> droplist){
        this.droplist = droplist;
    }

    @Override
    public int hashCode(){
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0:key.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj){
        if(this == obj){
            return true;
        }
        if(obj == null){
            return false;
        }
        if(getClass() != obj.getClass()){
            return false;
        }
        RaidbossDroplist other = (RaidbossDroplist)obj;
        if(key == null){
            if(other.key != null){
                return false;
            }
        }else if( ! key.equals(other.key)){
            return false;
        }
        return true;
    }
}
